package com.twu.biblioteca;

import java.util.List;

public class BibliotecaMovieList implements BibliotecaCommand {
    private BibliotecaApp bibliotecaApp;

    public BibliotecaMovieList(BibliotecaApp bibliotecaApp) {
        this.bibliotecaApp = bibliotecaApp;
    }

    @Override
    public void execute() {
        StringBuilder currentMovieList = new StringBuilder();
        List<LibraryMovie> movieList = bibliotecaApp.getMovieList();

        for (LibraryMovie movie : movieList) {
            currentMovieList.append(movie.toString());
        }
        bibliotecaApp.outputMessage(currentMovieList.toString());
    }
}
